#ifndef SYNC_REQUEST_TASK_H
#define SYNC_REQUEST_TASK_H

#include "sync_task.h"

namespace task
{
class SyncRequestTask;
using SyncRequestTaskConstPtr = std::shared_ptr<SyncRequestTask>;
/**
 * @brief:  短请求任务，只需要重写onStart()即可
 * @author: sherlock_lht
 */
class SyncRequestTask: public AbstractTask
{
public:
    explicit SyncRequestTask(const std::string &name);
    ~SyncRequestTask() override;

    bool onStart() override = 0;

    TaskStatus onRunning() final;

    bool onPause() final;

    bool onResume() final;

    void onCancel() final;

    bool onTimeout() final;

    void onHalt() final;

    [[nodiscard]] TaskType getTaskType() const final
    {
        return SYNC_REQUEST_TASK;
    }
};
}

#endif //SYNC_REQUEST_TASK_H
